package foundamental.version3;



import java.util.ArrayList;
import java.util.List;

/**
 * Created by chenjun on 2017/12/18.
 */
public class A {

    private  C c = new C();
    List<B> bList = new ArrayList<>();
    public A(){
        bList.add(new B(1));
        bList.add(new B(2));
        bList.add(new B(3));
        bList.add(new B(4));
    }

    private  int i = -1;
    public  void am1(){
        i++;
        if(i>= bList.size()) {
            c.cm1();
        }else {


            B b = bList.get(i);
            b.bm1(this);
            //System.out.println("method 1 in a----" + i);
        }
    }
}
